****************************************************************************
*Delivering remote learning using a low-tech solution: Evidence from an RCT during school closures, Liang Choon Wang, Michael Vlassopoulos, Asad Islam, and Hashibul Hassan, Journal of Political Economy: Micro, 2.3 (2024): 562–601.
****************************************************************************

****************************************************
*Do file for labeling and cleaning field data
****************************************************

**Parental Survey clean up**
pwd
import excel "Anushilon-Endline-Parent-Survey.xlsx", sheet("Other_Children_group") firstrow clear

local str "anu_se_7_1	anu_se_7_2	anu_se_7_3"
foreach X of local str{
	destring `X', replace
	}

label variable anu_se_7_1 "Gender of this child"
label define anu_se_7_1l 0 "Female" 1 "Male"
label values anu_se_7_1 anu_se_7_1l

label variable anu_se_7_2 "In which level this child is currently studying?"
label define anu_se_7_2l 0 "Under school age" 1 "Primary level" 2 "Secondary level" 3 "Higher secondary" 4 "Degree college" 5 "University level" 99 "Not applicable (do not study)" 
label values anu_se_7_2 anu_se_7_2l

label variable anu_se_7_3 "If not studying, what this child is doing?"
label define anu_se_7_3l 1 "Working after study" 2 "Working without finishing study" 3 "Got married" 4 "Unemployed" 5 "Migrant" 
label values anu_se_7_3 anu_se_7_3l

**long to wide**

by _parent_index, sort:  gen child_serial=_n
order _parent_index child_serial
drop _index
rename _parent_index _index
gen child="_ch"+string(child_serial,"%2.0f")
drop child_serial
reshape wide anu_se_7_1 - anu_se_7_3, i(_index) j(child, string) 

save other_child_data, replace

***Use master survey file from excel
import excel "Anushilon-Endline-Parent-Survey.xlsx", sheet("Anushilon-Endline-Parent-Sur...") firstrow clear

local str "CHILD_ID anu_hh_reli anu_res_rel anu_res_nm anu_se_1 anu_se_2 anu_se_3 anu_se_4 anu_se_5 anu_se_6 anu_se_7 anu_child_order anu_se_8 anu_se_9 anu_se_10 anu_se_11 anu_se_12 anu_se_13 anu_edu_1 anu_edu_2 anu_edu_3 anu_edu_4 anu_edu_5 anu_edu_6 anu_edu_7 anu_edu_8 anu_edu_9 anu_edu_10 anu_edu_11 anu_edu_12 anu_edu_13 anu_edu_14 anu_edu_15 anu_edu_16 anu_edu_17 anu_edu_18 anu_edu_19 anu_edu_20 anu_edu_21 anu_edu_22 anu_pi_1 anu_pi_2 anu_pi_3 anu_pi_4 anu_pi_5 anu_pi_6 anu_pi_7 anu_pi_8 anu_pi_9 anu_pi_10 anu_pi_11 anu_pi_12 anu_pi_13 anu_pi_14 anu_pi_15 anu_pi_16 anu_pi_17 anu_pi_18 anu_pi_19 anu_pi_20 anu_pi_21 anu_pi_22 anu_pi_23 anu_pi_24 anu_negP1 anu_negP2 anu_negP3 anu_negP4 anu_negP5 anu_negP6 anu_PA1 anu_PA2 anu_PA3 anu_PA4 anu_PA5 anu_PA6 anu_PA7 anu_PA8 anu_PA9 anu_PA10 anu_PA11 anu_sdq1 anu_sdq2 anu_sdq3 anu_sdq4 anu_sdq5 anu_sdq6 anu_sdq7 anu_sdq8 anu_sdq9 anu_sdq10 anu_sdq11 anu_sdq12 anu_sdq13 anu_sdq14 anu_sdq15 anu_sdq16 anu_sdq17 anu_sdq18 anu_sdq19 anu_sdq20 anu_sdq21 anu_sdq22 anu_sdq23 anu_sdq24 anu_sdq25 anu_ren_lead1 anu_ren_lead2 anu_ren_lead3 anu_ren_lead4 anu_ren_lead5 anu_ren_lead6 anu_ren_lead7 anu_ren_com1 anu_ren_com2 anu_ren_com3 anu_ren_com4 anu_ren_plan1 anu_ren_plan2 anu_ren_plan3 anu_ren_plan4 anu_ren_plan5 anu_ren_plan6 anu_ren_plan7 anu_ren_plan8 anu_ren_plan9 anu_ren_plan10 anu_ren_plan11 anu_ren_plan12 anu_ren_plan13 anu_ren_plan14 anu_ren_plan15 anu_sds1 anu_sds2 anu_sds3 anu_sds4 anu_sds5 anu_sds6 anu_sds7 anu_sds8 anu_sds9 anu_sds10 anu_sds11 anu_sds12 anu_sds13"
foreach X of local str{
	destring `X', replace
	}
	
*Full survey
merge 1:1 _index using "other_child_data.dta"

erase other_child_data.dta

drop _index _merge

*Label define
label	define	rel			1 "Islam" 2 "Hinduism" 3 "Buddhism" 4 "Christianity" 5 "Other" 
label	define 	relation 	1 "Mother" 2 "Father" 3 "Grandmother" 4 "Grandfather" 5 "Aunt" 6 "Uncle" 7 "Other" 
label 	define 	nomother 	1 "Deceased" 2 "Extremely sick" 3 "Living another place" 4 "Other"
label 	define 	profession 	1 "Housewife" 2 "Farming/fishing" 3 "Small business" 4 "Medium business" 5 "Service (govt)" 6 "Service (pvt)" 7 "Craftsman" 8 "Day laborer" 9 "Seasonal laborer" 10 "Unemployed" 11 "Migrant" 12 "Deceased" 
label 	define 	yesno 		1 "Yes"	0 "No"
label 	define 	anu_se_9l 	1 "Spouse" 2 "Child" 3 "parents/ parents-in-law" 4 "Other members"
label 	define 	econ_loss 	1 "Job loss" 2 "Business closure" 3 "Crop loss" 4 "Return from migrating country" 5 "Death of main earner" 6 "Leave of main earner" 7 "Other"
label 	define 	anu_se_13l 	1 "Cropland" 2 "non-crop land" 3 "business" 4 "Jewellery" 5 "others"
label 	define	anu_edu_2l	1 "More school days" 2 "all days" 3 "School after vaccination"
label 	define	irregular	1 "Don't want to study" 2 "Forget to read & write" 3 "Sick" 4 "Start working" 5 "Shift to Madrasa"
label	define 	educatchup	1 "Can't catchup at all" 2 "Slightly catchup" 3 "Somewhat catchup" 4 "Catching up well" 5 "Completely catching up"
label 	define	teachereffort 1 "Not at all" 2 "A little" 3 "Moderate amount" 4 "High amount" 5 "A great deal"
label 	define 	edurecovery	1 "No, it will remain lifelong" 2 "Yes, but will take time" 3 "Yes, but will take several months" 4 "Yes, no problem"
label 	define 	frequency 	1 "Very Rarely" 2 "Rarely" 3 "Occasionally" 4 "Frequently" 5 "Very Frequently"
label 	define 	quantity	1 "Not at all" 2 "A little" 3 "Moderate amount" 4 "High amount" 5 "A great deal"
label	define 	pvttution 	1 "Yes, no pvt tuition before" 2 "No, has studying to pvt tutor" 
label 	define 	education 	1 "Primary grades" 2 "upto grade 8" 3 "SSC" 4 "HSC" 5 "Honours/degree" 6 "Master level" 7 "Doctor/Engineer"
label	define 	anu_negP1l 	0 "try to make happy" 1 "ignore"
label	define 	anu_negPl 	0 "No" 1 "Yes"
label 	define 	pabilty 	1 "Extremely bad" 2 "Somewhat bad" 3 "Neither good nor bad" 4 "Somewhat good" 5 "Extremely good" 
label 	define 	sdq 		0 "Not true" 1 "Somewhat true" 2 "Certainly true"
label 	define 	renzulli	1 "Never" 2 "Very Rarely" 3 "Rarely" 4 "Occasionally" 5 "Frequently" 6 "Always"
label	define 	sds 		0 "True" 1 "False"

*label applied
label values anu_hh_reli 	rel
label values anu_res_rel 	relation 
label values anu_res_nm 	nomother
label values anu_se_1 		profession
label values anu_se_2 		profession
label values anu_se_4 		yesno 
label values anu_se_8 		yesno
label values anu_se_9 		anu_se_9l 
label values anu_se_10		yesno
label values anu_se_11		econ_loss
label values anu_se_12		yesno
label values anu_se_13		anu_se_13l 
label values anu_edu_1		yesno
label values anu_edu_2		anu_edu_2l
label values anu_edu_4 		yesno  
label values anu_edu_5		irregular
label values anu_edu_6		educatchup 
label values anu_edu_7		teachereffort
label values anu_edu_8		edurecovery
label values anu_edu_9		yesno 
label values anu_edu_12		pvttution
label values anu_edu_13		yesno 
label values anu_edu_14		frequency
label values anu_edu_15 	quantity
label values anu_edu_16		quantity
label values anu_edu_17		quantity
label values anu_pi_1		yesno
label values anu_pi_2		yesno
label values anu_pi_3		yesno
label values anu_pi_4		quantity
label values anu_pi_10		quantity
label values anu_pi_23		yesno
label values anu_pi_24		education
label values anu_negP1		anu_negP1l
label values anu_negP2		anu_negPl
label values anu_negP3		anu_negPl
label values anu_negP4		anu_negPl
label values anu_negP5		anu_negPl
label values anu_negP6		anu_negPl

foreach X of varlist anu_PA1 - anu_PA11{
	label values `X' pabilty
	}

foreach X of varlist anu_sdq1 - anu_sdq25{
	label values `X' sdq
	}
	
foreach X of varlist anu_ren_lead1 - anu_ren_lead7 anu_ren_com1 - anu_ren_com4 anu_ren_plan1 - anu_ren_plan15{
	label values `X' renzulli
	}

foreach X of varlist anu_sds1 - anu_sds13{
	label values `X' sds
	}

*label variable
label variable	CHILD_ID 		"Child id"
label variable 	anu_hh_reli 	"Religion of the Household"
label variable 	anu_res_rel  	"Respondent’s relationship with child"
label variable 	anu_res_nm  	"Reason for the absence of mother"
label variable 	anu_se_1  		"Respondents’s profession"
label variable 	anu_se_2  		"Respondent’s spouse’s profession"
label variable 	anu_se_3  		"Household’s monthly income"
label variable 	anu_se_4  		"Does monthly income reduce in this year?"
label variable 	anu_se_5  		"If yes, by how much?"
label variable 	anu_se_6  		"Number of household members"
label variable 	anu_se_7  		"How many children you have except the program child"
label variable 	anu_se_8  		"Does any member of the household had died this year?"
label variable 	anu_se_9  		"If yes, what was his/her relationship with you?"
label variable 	anu_se_10  		"Does your household face any big financial shock this year?"
label variable 	anu_se_11  		"If yes, what was that loss"
label variable 	anu_se_12  		"Does your household sell any asset due to lack of income?"
label variable	anu_se_13 		"What asset"
label variable 	anu_edu_1  		"Do you satisfy the with partial opening of school?"
label variable 	anu_edu_2  		"Why you are unsatisfied?"
label variable 	anu_edu_3  		"How many days in a week school remains open?"
label variable 	anu_edu_4  		"Does your child going to school regularly?"
label variable	anu_edu_5 		"Why the child is not going to school regularly?"
label variable	anu_edu_6		"Does your child catching up the school lessons?"
label variable	anu_edu_7 		"Do you think teachers' are giving enough effort to recover the learning loss?"
label variable	anu_edu_8		"Do you think your child could recover the learning loss?"
label variable 	anu_edu_9		"Does your child currently study to any private tutor?"
label variable 	anu_edu_10		"How many tutors he/she currently has? "
label variable 	anu_edu_11  	"How much per month you spend for his/her private tuition? "
label variable 	anu_edu_12		"Do you start private tuition due to the COVID-19 related school closure?"
label variable 	anu_edu_13  	"Does anyone other than the tutors help the child in study without money?"
label variable 	anu_edu_14		"If yes, how much time he/she give to your child?"
label variable 	anu_edu_15		"In last few weeks, How much time your child spend for studying?"
label variable 	anu_edu_16		"How interested your child is in studying?"
label variable 	anu_edu_17		"How attentive your child is in studying?"
label variable 	anu_edu_18		"Study time, Bangla"
label variable 	anu_edu_19		"Study time, English"
label variable 	anu_edu_20		"Study time, Math"
label variable 	anu_edu_21		"Study time, other subjects"
label variable 	anu_edu_22		"Study time, total"
label variable 	anu_pi_1		"Do you teach the child at home regulary?"
label variable 	anu_pi_2		"Does your spouse teach the child at home regularly?"
label variable 	anu_pi_3		"Does anyone other than you and your spouse teach the child regularly?"
label variable	anu_pi_4		"In the past weeks, how much time you gave in child’s education? "
label variable 	anu_pi_5 		"Daily parental time in education - Bengali"
label variable 	anu_pi_6		"Daily parental time in education – English"
label variable 	anu_pi_7		"Daily parental time in education – Mathmatics "
label variable 	anu_pi_8		"Daily parental time in education – other subjects"
label variable 	anu_pi_9		"Daily parental time in education – total"
label variable 	anu_pi_10  		"In the past weeks, how much time you gave in child’s other activities?"
label variable 	anu_pi_11		"Daily parental time in non-educational activities – play"
label variable 	anu_pi_12  		"Daily parental time in non-educational activities – chit-chat"
label variable 	anu_pi_13		"Daily parental time in non-educational activities – take out for walk  "
label variable 	anu_pi_14  		"Daily parental time in non-educational activities – household work"
label variable 	anu_pi_15 		"Daily parental time in non-educational activities – cultural activities "
label variable 	anu_pi_16		"Daily parental time in non-educational activities – Total"
label variable 	anu_pi_17  		"Do your spouse (father) love to help your child in study?"
label variable 	anu_pi_18 		"Do you (mother) love to help your child in study?"
label variable 	anu_pi_19  		"Does your child love to study with your spouse (father)?"
label variable 	anu_pi_20  		"Does your child love to study with you (mother)?"
label variable 	anu_pi_21  		"How much capable you are in helping the child in study (father)?"
label variable 	anu_pi_22 		"How much capable you are in helping the child in study (mother)?"
label variable 	anu_pi_23  		"Do you think your child will able to finish S.S.C level? "
label variable 	anu_pi_24  		"How far in education this child could finish?"
label variable 	anu_negP1  		"If your child sad, unhappy or angry, what do you do?"
label variable 	anu_negP2  		"Do you use or feel that your child is worthless or could not do anything in life?"
label variable 	anu_negP3  		"Do you think your child couldn’t do any good in his/her life?"
label variable 	anu_negP4  		"Do you think your child shows excessive tantrum or is the reason for your unhappiness?  "
label variable 	anu_negP5  		"Do you beat your child with kane, stick or bare hand? "
label variable 	anu_negP6  		"Do you think it is needed to beat child to make them good people or successful in life? "
label variable 	anu_PA1			"Reading books and story to the child"
label variable 	anu_PA2			"Helping the child learn what words mean"
label variable 	anu_PA3  		"Talking about the main idea in a story or book"
label variable 	anu_PA4			"Providing books for the child to read "
label variable 	anu_PA5			"Helping the child to do mathematics "
label variable 	anu_PA6			"Helping the child with homework "
label variable 	anu_PA7  		"Helping to reinforce what a child’s teacher or mentor has taught"
label variable 	anu_PA8  		"Finding out about child’s study progress "
label variable 	anu_PA9 		"Regulating the screen time, playing with friends, time spent outside of home etc."
label variable 	anu_PA10 		"Taking child to roam outside"
label variable 	anu_PA11        "Talking with the child in friendly manner"

foreach X of varlist anu_se_7_1_ch* {
	label variable `X' "Gender of child (sibling)"
	}

foreach X of varlist anu_se_7_2_ch* {
	label variable `X' "If studying, which grade?"
	}

	foreach X of varlist anu_se_7_3_ch* {
	label variable `X' "If not studying, what they do?"
	}

****New variable creation
*SDQ
gen pconsid		=	anu_sdq1
gen	prestles	=	anu_sdq2
gen psomatic	=	anu_sdq3
gen pshares		=	anu_sdq4
gen ptantrum	=	anu_sdq5
gen ploner		=	anu_sdq6
gen pobeys		=	anu_sdq7
gen pworries	=	anu_sdq8
gen pcaring		=	anu_sdq9
gen pfidgety	=	anu_sdq10
gen pfriend		=	anu_sdq11
gen pfights		=	anu_sdq12
gen punhappy	=	anu_sdq13
gen ppopular	=	anu_sdq14
gen pdistrac	=	anu_sdq15
gen pclingy		=	anu_sdq16
gen pkind		=	anu_sdq17
gen plies		=	anu_sdq18
gen pbullied	=	anu_sdq19
gen phelpout	=	anu_sdq20
gen preflect	=	anu_sdq21
gen psteals		=	anu_sdq22
gen poldbest	=	anu_sdq23
gen pafraid		=	anu_sdq24
gen pattends	=	anu_sdq25

recode pobeys (0=2) (1=1) (2=0) (else=.), gen(qobeys)
recode preflect (0=2) (1=1) (2=0) (else=.) , gen(qreflect)
recode pattends (0=2) (1=1) (2=0) (else=.), gen(qattends)
recode pfriend (0=2) (1=1) (2=0) (else=.), gen(qfriend)
recode ppopular (0=2) (1=1) (2=0) (else=.), gen(qpopular)

egen 	nemotion	=	robs(psomatic pworries punhappy pclingy pafraid)
egen 	sdq_emotion	=	rmean(psomatic pworries punhappy pclingy pafraid) if nemotion>2
replace sdq_emotion	=	round(sdq_emotion*5)
label 	variable	sdq_emotion	"SDQ - Emotional Symptoms"

egen 	nconduct	=	robs(ptantrum qobeys pfights plies psteals)
egen 	sdq_conduct	=	rmean(ptantrum qobeys pfights plies psteals) if nconduct>2
replace sdq_conduct	=	round(sdq_conduct*5)
label 	variable	sdq_conduct	"SDQ - conduct problems"

egen 	nhyper		=	robs(prestles pfidgety pdistrac qreflect qattends)
egen 	sdq_hyper	=	rmean(prestles pfidgety pdistrac qreflect qattends) if nhyper>2
replace sdq_hyper	=	round(sdq_hyper*5)
label 	variable	sdq_hyper	"SDQ - hyperactivity/inattention"

egen 	npeer		=	robs(ploner qfriend qpopular pbullied poldbest)
egen 	sdq_peer	=	rmean(ploner qfriend qpopular pbullied poldbest) if npeer>2
replace sdq_peer	=	round(sdq_peer*5)
label 	variable	sdq_peer	"SDQ - peer problems"

egen 	nprosoc		=	robs(pconsid pshares pcaring pkind phelpout)
egen 	sdq_prosoc	=	rmean(pconsid pshares pcaring pkind phelpout) if nprosoc>2
replace sdq_prosoc	=	round(sdq_prosoc*5)
label 	variable	sdq_prosoc	"SDQ - prosocial"

drop qobeys qreflect qattends qfriend qpopular nemotion nconduct nhyper npeer nprosoc pconsid	prestles psomatic pshares ptantrum ploner pobeys pworries pcaring pfidgety pfriend pfights punhappy ppopular pdistrac pclingy pkind plies pbullied phelpout preflect psteals poldbest pafraid pattends 

gen sdq_totdiff 	=	sdq_emotion	+	sdq_conduct	+	sdq_hyper	+	sdq_peer
label 	variable	sdq_totdiff	"SDQ - total difficulties - firs 4 sub-scale"

*Renzulli scale
egen 	leadership 		= 	rowtotal(anu_ren_lead*)
label	variable 		leadership	"Parent reported - Leadership skill"
	
egen 	communication 	= 	rowtotal(anu_ren_com*)
label	variable 		communication	"Parent reported - Communication skill"

egen 	planning 		= 	rowtotal(anu_ren_plan*)
label	variable 		planning	"Parent reported - planning skill"

*Social Desireabiltiy scale 
recode anu_sds5 (0=1) (1=0) (else=.), gen(anu_sds5r)
recode anu_sds7 (0=1) (1=0) (else=.), gen(anu_sds7r)
recode anu_sds9 (0=1) (1=0) (else=.), gen(anu_sds9r)
recode anu_sds10 (0=1) (1=0) (else=.), gen(anu_sds10r)
recode anu_sds13 (0=1) (1=0) (else=.), gen(anu_sds13r)

egen 	social_desire_mother 		= 	rowtotal(anu_sds1 anu_sds2 anu_sds3 anu_sds4 anu_sds5r anu_sds6 anu_sds7r anu_sds8 anu_sds9r anu_sds10r anu_sds11 anu_sds12 anu_sds13r)
label	variable 		social_desire_mother	"Social desirability scale - mother"

*saving clean parental survey dataset
save Anushilon-Endline-Parent-Survey.dta, replace

*********************************************************************
*Assessment clean up start from here*
*********************************************************************
import excel "Anushilon-Endline-Assessment.xlsx", firstrow clear

local str "CHILD_ID anu_e1_grade anu_e1_schooltype anu_e1_gender anu_e1_cog1_1 anu_e1_cog1_2 anu_e1_cog1_3 anu_e1_cog1_4 anu_e1_cog1_5 anu_e1_cog1_6 anu_e1_cog1_7 anu_e1_cog1_8 anu_e1_cog1_9 anu_e1_cog1_10 anu_e1_cog1_11 anu_e1_cog1_12 anu_e1_cog1_13 anu_e1_cog1_14 anu_e1_cog1_15 anu_e1_cog1_16 anu_e1_cog1_17 anu_e1_cog1_18 anu_e1_cog1_19 anu_e1_cog2_1 anu_e1_cog2_2 anu_e1_cog2_3 anu_e1_cog2_4 anu_e1_cog2_5 anu_e1_cog2_6 anu_e1_cog2_7 anu_e1_cog2_8 anu_e1_cog2_9 anu_e1_cog2_10 anu_e1_cog2_11 anu_e1_cog2_12 anu_e1_cog2_13 anu_e1_cog2_14 anu_e1_cog2_15 anu_e1_cog2_16 anu_e1_cog2_17 anu_e1_cog2_18 anu_e1_cog2_19 anu_e1_cog3_1 anu_e1_cog3_2 anu_e1_cog3_3 anu_e1_cog3_4 anu_e1_cog3_5 anu_e1_cog3_6 anu_e1_cog3_7 anu_e1_cog3_8 anu_e1_cog3_9 anu_e1_cog3_10 anu_e1_cog3_11 anu_e1_cog3_12 anu_e1_cog3_13 anu_e1_cog3_14 anu_e1_cog3_15 anu_e1_cog3_16 anu_e1_cog3_17 anu_e1_cog3_18 anu_e1_cog3_19 anu_grit1 anu_grit2 anu_grit3 anu_grit4 anu_grit5 anu_grit6 anu_grit7 anu_grit8 anu_isc1 anu_isc2 anu_isc3 anu_isc4 anu_isc5 anu_isc6 anu_isc7 anu_isc8 anu_gms1 anu_gms2 anu_gms3 anu_EmQue1 anu_EmQue2 anu_EmQue3 anu_EmQue4 anu_EmQue5 anu_EmQue6 anu_EmQue7 anu_EmQue8 anu_EmQue9 anu_EmQue10 anu_EmQue11 anu_EmQue12 anu_EmQue13 anu_EmQue14 anu_EmQue15 anu_EmQue16 anu_EmQue17 anu_EmQue18 anu_childsocialdesirability1 anu_childsocialdesirability2 anu_childsocialdesirability3 anu_childsocialdesirability4 anu_childsocialdesirability5 anu_childsocialdesirability6 anu_childsocialdesirability7 anu_childsocialdesirability8 anu_childsocialdesirability9 anu_childsocialdesirability10 anu_childsocialdesirability11 anu_childsocialdesirability12 anu_childsocialdesirability13 anu_childsocialdesirability14"
foreach X of local str{
	destring `X', replace
	}

*Label Variables 
label variable CHILD_ID 			"Child ID"
label variable anu_e1_grade 		"Grade of Study"
label variable anu_e1_schooltype 	"Type of educational institute"
label variable anu_e1_gender		"Gender of the child"
label variable anu_e1_cog1_1 		"Level 1 - Bng Lit - 1"
label variable anu_e1_cog1_2 		"Level 1 - Bng Lit - 2"
label variable anu_e1_cog1_3 		"Level 1 - Bng Lit - 3"
label variable anu_e1_cog1_4 		"Level 1 - Bng Lit - 4"
label variable anu_e1_cog1_5 		"Level 1 - Gen Know - 5"
label variable anu_e1_cog1_6 		"Level 1 - Gen Know - 6"
label variable anu_e1_cog1_7 		"Level 1 - Gen Know - 7"
label variable anu_e1_cog1_8 		"Level 1 - Gen Know - 8"
label variable anu_e1_cog1_9 		"Level 1 - Eng Lit - 9"
label variable anu_e1_cog1_10 		"Level 1 - Eng Lit - 10" 
label variable anu_e1_cog1_11 		"Level 1 - Eng Lit - 11" 
label variable anu_e1_cog1_12 		"Level 1 - Eng Lit - 12"
label variable anu_e1_cog1_13 		"Level 1 - Eng Lit - 13"
label variable anu_e1_cog1_14 		"Level 1 - Eng Lit - 14"
label variable anu_e1_cog1_15 		"Level 1 - Numeracy - 15"
label variable anu_e1_cog1_16 		"Level 1 - Numeracy - 16"
label variable anu_e1_cog1_17 		"Level 1 - Numeracy - 17"
label variable anu_e1_cog1_18 		"Level 1 - Numeracy - 18"
label variable anu_e1_cog1_19 		"Level 1 - Numeracy - 19"
label variable anu_e1_cog2_1 		"Level 2 - Bng Lit - 1"
label variable anu_e1_cog2_2 		"Level 2 - Bng Lit - 2"
label variable anu_e1_cog2_3 		"Level 2 - Bng Lit - 3"
label variable anu_e1_cog2_4 		"Level 2 - Bng Lit - 4"
label variable anu_e1_cog2_5 		"Level 2 - Gen Know - 5"
label variable anu_e1_cog2_6 		"Level 2 - Gen Know - 6"
label variable anu_e1_cog2_7 		"Level 2 - Gen Know - 7"
label variable anu_e1_cog2_8 		"Level 2 - Gen Know - 8"
label variable anu_e1_cog2_9 		"Level 2 - Eng Lit - 9"
label variable anu_e1_cog2_10 		"Level 2 - Eng Lit - 10" 
label variable anu_e1_cog2_11 		"Level 2 - Eng Lit - 11" 
label variable anu_e1_cog2_12 		"Level 2 - Eng Lit - 12"
label variable anu_e1_cog2_13 		"Level 2 - Eng Lit - 13"
label variable anu_e1_cog2_14 		"Level 2 - Eng Lit - 14"
label variable anu_e1_cog2_15 		"Level 2 - Numeracy - 15"
label variable anu_e1_cog2_16 		"Level 2 - Numeracy - 16"
label variable anu_e1_cog2_17 		"Level 2 - Numeracy - 17"
label variable anu_e1_cog2_18 		"Level 2 - Numeracy - 18"
label variable anu_e1_cog2_19 		"Level 2 - Numeracy - 19"
label variable anu_e1_cog3_1 		"Level 3 - Bng Lit - 1"
label variable anu_e1_cog3_2 		"Level 3 - Bng Lit - 2"
label variable anu_e1_cog3_3 		"Level 3 - Bng Lit - 3"
label variable anu_e1_cog3_4 		"Level 3 - Bng Lit - 4"
label variable anu_e1_cog3_5 		"Level 3 - Gen Know - 5"
label variable anu_e1_cog3_6 		"Level 3 - Gen Know - 6"
label variable anu_e1_cog3_7 		"Level 3 - Gen Know - 7"
label variable anu_e1_cog3_8 		"Level 3 - Gen Know - 8"
label variable anu_e1_cog3_9 		"Level 3 - Eng Lit - 9"
label variable anu_e1_cog3_10 		"Level 3 - Eng Lit - 10" 
label variable anu_e1_cog3_11 		"Level 3 - Eng Lit - 11" 
label variable anu_e1_cog3_12 		"Level 3 - Eng Lit - 12"
label variable anu_e1_cog3_13 		"Level 3 - Eng Lit - 13"
label variable anu_e1_cog3_14 		"Level 3 - Eng Lit - 14"
label variable anu_e1_cog3_15 		"Level 3 - Numeracy - 15"
label variable anu_e1_cog3_16 		"Level 3 - Numeracy - 16"
label variable anu_e1_cog3_17 		"Level 3 - Numeracy - 17"
label variable anu_e1_cog3_18 		"Level 3 - Numeracy - 18"
label variable anu_e1_cog3_19 		"Level 3 - Numeracy - 19"

*Label values - define
label define schooltype 1 "Govt primary school" 2 "Madrasa" 3 "Pvt or NGO" 4 "No formal school"
label define gender 1 "Female" 0 "Male"
label define grit 1 "Very much like me" 2 "Mostly like me" 3 "Somewhat like me" 4 "Not much like me" 5 "Not like me at all"
label define isc 1 "Almost never" 2 "About once a month" 3 "About 2-3 times a month" 4 "About once a week" 5 "At least once a day"
label define gms 1 "strongly agree" 2 "agree" 3 "mostly agree" 4 "mostly disagree" 5 "disagree" 6 "strongly disagree"
label define emque 0 "Not True" 1 "Sometimes True" 2 "Often True"
label define childsocialdes 0 "Yes" 1 "No"

*Label values - assign 
label values 	anu_e1_schooltype	schooltype 
label values 	anu_e1_gender 		gender

foreach X of varlist anu_grit* {
	label values `X' grit
	}

foreach X of varlist anu_isc* {
	label values `X' isc
	}

foreach X of varlist anu_gms* {
	label values `X' gms
	}

foreach X of varlist anu_EmQue* {
	label values `X' emque
	}

foreach X of varlist anu_childsocialdesirability* {
	label values `X' childsocialdes
	}	

*Recreation of variables 
*Cognitive
egen anu_e1_cog_1 	= 	rowtotal(anu_e1_cog1_1 anu_e1_cog2_1 anu_e1_cog3_1)
egen anu_e1_cog_2 	= 	rowtotal(anu_e1_cog1_2 anu_e1_cog2_2 anu_e1_cog3_2)
egen anu_e1_cog_3 	= 	rowtotal(anu_e1_cog1_3 anu_e1_cog2_3 anu_e1_cog3_3)
egen anu_e1_cog_4 	= 	rowtotal(anu_e1_cog1_4 anu_e1_cog2_4 anu_e1_cog3_4)
egen anu_e1_cog_5 	= 	rowtotal(anu_e1_cog1_5 anu_e1_cog2_5 anu_e1_cog3_5)
egen anu_e1_cog_6 	= 	rowtotal(anu_e1_cog1_6 anu_e1_cog2_6 anu_e1_cog3_6)
egen anu_e1_cog_7 	= 	rowtotal(anu_e1_cog1_7 anu_e1_cog2_7 anu_e1_cog3_7)
egen anu_e1_cog_8 	= 	rowtotal(anu_e1_cog1_8 anu_e1_cog2_8 anu_e1_cog3_8)
egen anu_e1_cog_9 	= 	rowtotal(anu_e1_cog1_9 anu_e1_cog2_9 anu_e1_cog3_9)
egen anu_e1_cog_10 	= 	rowtotal(anu_e1_cog1_10 anu_e1_cog2_10 anu_e1_cog3_10)
egen anu_e1_cog_11 	= 	rowtotal(anu_e1_cog1_11 anu_e1_cog2_11 anu_e1_cog3_11)
egen anu_e1_cog_12 	= 	rowtotal(anu_e1_cog1_12 anu_e1_cog2_12 anu_e1_cog3_12)
egen anu_e1_cog_13 	= 	rowtotal(anu_e1_cog1_13 anu_e1_cog2_13 anu_e1_cog3_13)
egen anu_e1_cog_14 	= 	rowtotal(anu_e1_cog1_14 anu_e1_cog2_14 anu_e1_cog3_14)
egen anu_e1_cog_15 	= 	rowtotal(anu_e1_cog1_15 anu_e1_cog2_15 anu_e1_cog3_15)
egen anu_e1_cog_16 	= 	rowtotal(anu_e1_cog1_16 anu_e1_cog2_16 anu_e1_cog3_16)
egen anu_e1_cog_17 	= 	rowtotal(anu_e1_cog1_17 anu_e1_cog2_17 anu_e1_cog3_17)
egen anu_e1_cog_18 	= 	rowtotal(anu_e1_cog1_18 anu_e1_cog2_18 anu_e1_cog3_18)
egen anu_e1_cog_19 	=	rowtotal(anu_e1_cog1_19 anu_e1_cog2_19 anu_e1_cog3_19)

label variable anu_e1_cog_1 	"All Grade - Bng Lit - 1" 
label variable anu_e1_cog_2 	"All Grade - Bng Lit - 2"
label variable anu_e1_cog_3 	"All Grade - Bng Lit - 3"
label variable anu_e1_cog_4 	"All Grade - Bng Lit - 4"
label variable anu_e1_cog_5 	"All Grade - Gen Know - 5"
label variable anu_e1_cog_6 	"All Grade - Gen Know - 6"
label variable anu_e1_cog_7 	"All Grade - Gen Know - 7"
label variable anu_e1_cog_8 	"All Grade - Gen Know - 8"
label variable anu_e1_cog_9 	"All Grade - Eng Lit - 9"
label variable anu_e1_cog_10 	"All Grade - Eng Lit - 10" 
label variable anu_e1_cog_11 	"All Grade - Eng Lit - 11" 
label variable anu_e1_cog_12 	"All Grade - Eng Lit - 12"
label variable anu_e1_cog_13 	"All Grade - Eng Lit - 13"
label variable anu_e1_cog_14 	"All Grade - Eng Lit - 14"
label variable anu_e1_cog_15 	"All Grade - Numeracy - 15"
label variable anu_e1_cog_16 	"All Grade - Numeracy - 16"
label variable anu_e1_cog_17 	"All Grade - Numeracy - 17"
label variable anu_e1_cog_18 	"All Grade - Numeracy - 18"
label variable anu_e1_cog_19 	"All Grade - Numeracy - 19"

egen anu_e1_cog_tot = rowtotal(anu_e1_cog_1 anu_e1_cog_10 anu_e1_cog_11 anu_e1_cog_12 anu_e1_cog_13 anu_e1_cog_14 anu_e1_cog_15 anu_e1_cog_16 anu_e1_cog_17 anu_e1_cog_18 anu_e1_cog_19 anu_e1_cog_2 anu_e1_cog_3 anu_e1_cog_4 anu_e1_cog_9)
label variable anu_e1_cog_tot "All Grade - Total number"

egen anu_e1_cog_lit_bng = rowtotal(anu_e1_cog_1 anu_e1_cog_2 anu_e1_cog_3 anu_e1_cog_4)
label variable anu_e1_cog_lit_bng "All Grade - Literacy Bangla"

egen anu_e1_cog_gk = rowtotal(anu_e1_cog_5 anu_e1_cog_6 anu_e1_cog_7 anu_e1_cog_8)
label variable anu_e1_cog_gk "All Grade - General Knowledge"

egen anu_e1_cog_lit_eng = rowtotal(anu_e1_cog_9 anu_e1_cog_10 anu_e1_cog_11 anu_e1_cog_12 anu_e1_cog_13 anu_e1_cog_14)
label variable anu_e1_cog_lit_eng "All Grade - Literacy English"

egen anu_e1_cog_num = rowtotal(anu_e1_cog_15 anu_e1_cog_16 anu_e1_cog_17 anu_e1_cog_18 anu_e1_cog_19)
label variable anu_e1_cog_num "All Grade - Numeracy"

*grit scale 
revrs anu_grit2
revrs anu_grit4
revrs anu_grit7
revrs anu_grit8

egen grit = rowmean(anu_grit1 revanu_grit2 anu_grit3 revanu_grit4 anu_grit5 anu_grit6 revanu_grit7 revanu_grit8)
label variable grit "Grit Scale"

*ISC
egen impulsivity_overall		=	rowmean(anu_isc*)
egen impulsivity_schoolwork 	=	rowmean(anu_isc1 anu_isc4 anu_isc6 anu_isc7)
egen impulsivity_interpersonal 	=	rowmean(anu_isc2 anu_isc3 anu_isc5 anu_isc8)
 
label variable impulsivity_overall			"Overall impulsivity" 	
label variable impulsivity_schoolwork		"Schoolwork impulsivity"
label variable impulsivity_interpersonal	"Interpersonal impulsivity"

*Growth Mindset
egen 	gms	=	rowmean(anu_gms*)
label 	variable gms	"Grwoth Mindset Scale"

*empathy
egen affective_empathy 	=	rowmean(anu_EmQue1 anu_EmQue4 anu_EmQue7 anu_EmQue10 anu_EmQue13 anu_EmQue16 anu_EmQue18)
label variable affective_empathy "Affective Empathy (Contagion)"

egen cognitive_empathy	=	rowmean(anu_EmQue2 anu_EmQue5 anu_EmQue8 anu_EmQue11 anu_EmQue14)
label variable cognitive_empathy "Cognitive Empathy (Understanding)"

egen prosocial_empathy = rowmean(anu_EmQue3 anu_EmQue6 anu_EmQue9 anu_EmQue12 anu_EmQue15 anu_EmQue17)
label variable prosocial_empathy "Prosocial Motivation (Support)"

*Social Desireabiltiy Scale - Children
recode anu_childsocialdesirability2 	(0=1) (1=0) (else=.), gen(anu_childsocialdesirability2r)
recode anu_childsocialdesirability5 	(0=1) (1=0) (else=.), gen(anu_childsocialdesirability5r)
recode anu_childsocialdesirability7 	(0=1) (1=0) (else=.), gen(anu_childsocialdesirability7r)
recode anu_childsocialdesirability12 	(0=1) (1=0) (else=.), gen(anu_childsocialdesirability12r)

egen social_desire_child = rowtotal(anu_childsocialdesirability1 anu_childsocialdesirability2r anu_childsocialdesirability3 anu_childsocialdesirability4 anu_childsocialdesirability5r anu_childsocialdesirability6 anu_childsocialdesirability7r anu_childsocialdesirability8 anu_childsocialdesirability9 anu_childsocialdesirability10 anu_childsocialdesirability11 anu_childsocialdesirability12r anu_childsocialdesirability13 anu_childsocialdesirability14)

label variable social_desire_child "Social Desireabiltiy Scale - Child"

*Saving clean Assessment data
save Anushilon-Endline-Assessment.dta, replace